package cn.shop.gateway.utils;

import cn.hutool.core.util.StrUtil;

import static cn.shop.gateway.utils.Context.ScriptPath.*;

public interface Context {

    String MAX = "num.max";
    String STEP = "num.step";
    String MIN = "num.min";
    String PORT = "server.port";

    static String npcLocationFilePath(String folder) {
        return StrUtil.format(NPC_LOCATION_FILE, folder);
    }

    static String npcScriptFilePath(String folder, String name, String code) {
        return StrUtil.format(NPC_SCRIPT_FILE, folder, name, code);
    }

    static String scriptPath(String folder) {
        return StrUtil.format(SCRIPT_PATH, folder);
    }

    static String orderSellFilePath(String folder) {
        return StrUtil.format(ORDER_SELL_FILE, folder);
    }

    static String orderSellFilePathBak(String folder) {
        return StrUtil.format(ORDER_SELL_FILE_BAK, folder);
    }

    static String orderBuyPath(String folder, String name) {
        return StrUtil.format(ORDER_BUY_PATH, folder, name);
    }

    static String orderBuyFilePath(String folder, String name, String num) {
        return StrUtil.format(ORDER_BUY_FILE, folder, name, num);
    }

    static String playerCodeFilePath(String folder) {
        return StrUtil.format(PLAYER_CODE_FILE, folder);
    }

    static String playerBindFilePath(String folder) {
        return StrUtil.format(PLAYER_BIND_FILE, folder);
    }

    static String orderBuyReceiveFile(String folder, String name) {
        return StrUtil.format(ORDER_BUY_RECEIVE, folder, name);
    }

    interface Path {
        String PATH = "/gateway/api";
        String PARTITION_ADD = PATH + "/partition/add";
        String PARTITION_REMOVE = PATH + "/partition/remove";
        String BUY_ORDER = PATH + "/order/buy";
        String SET_URL = PATH + "/setUrl";
        String CHECK_CODE = PATH + "/checkCode";
        String BIND = PATH + "/bind";
        String UNBIND = PATH + "/unbind";
        String SECRET = PATH + "/secret";
        String PING = PATH + "/ping";
    }

    interface ScriptPath {
        String NPC_LOCATION_FILE = "{}/Mir200/Envir/MerChant.txt";
        String NPC_SCRIPT_FILE = "{}/Mir200/Envir/Market_Def/{}-{}.txt";

        String SCRIPT_PATH = "{}/Mir200/Envir/QuestDiary/担保交易/";
        String ORDER_SELL_FILE = SCRIPT_PATH + "商品.txt";
        String ORDER_SELL_FILE_BAK = SCRIPT_PATH + "商品_备份.txt";
        String PLAYER_CODE_FILE = SCRIPT_PATH + "角色_验证.txt";
        String PLAYER_BIND_FILE = SCRIPT_PATH + "角色_绑定.txt";

        String BUY_PATH = "{}/Mir200/Envir/QuestDiary/购买领取/";
        String ORDER_BUY_PATH = BUY_PATH + "{}/";
        String ORDER_BUY_RECEIVE = ORDER_BUY_PATH + "freenet.txt";
        String ORDER_BUY_FILE = ORDER_BUY_PATH + "{}.txt";
    }


}
